import { defineStore } from "pinia";

export const useUserStore = defineStore('user', {
    state: () => {
        return {
            name: '张三',
            gender: '男',
            age: 18
        }
    },
    getters: {},
    actions: {
        addAge() {
            this.age++
        }
    },
    persist: {
        enable: true,
        strategies: [
            {
                key: 'user',
                storage: localStorage
            }
        ]
    }
})